import { Shopcart } from '../../models/shopcart.js'
var shopcart = new Shopcart()
Component({ 
  externalClasses: ['book-list-extend'],
  properties: {
    shopcart:Object
  },

  data: {

  },

  methods: {
    deleteOne(event){
      this.triggerEvent('deleteone', { bookID: event.currentTarget.dataset.id})
    },

    onMakeOrder(event){
      if (this.properties.shopcart.selectedBookNum) {
        this.triggerEvent('makeorder')
      } else {
        shopcart.toast('请选择商品', 'none')
      }
    }
  }
})